Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shims/super/cc: allow -Werror=implicit-function-declaration #7358

Merged
merged 1 commit into from Apr 15, 2020

Conversation

Bo98
Copy link
Member

@Bo98 Bo98 commented Apr 14, 2020

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

I need this for .NET Core CLR to compile.

@MikeMcQuaid
Copy link
Member

What does this do, turn a specific warning into an error? Can this be filtered out (which would appear to be more consistent) rather than included?

@Bo98
Copy link
Member Author

Bo98 commented Apr 15, 2020

What does this do, turn a specific warning into an error?

Yes.

Can this be filtered out (which would appear to be more consistent) rather than included?

Possibly, though I don't know how far to take it.

In this particular example, the flag was relied on for feature detection. CMake was being tested to use if the following code compiled:

#include <libunwind.h>
int main(int argc, char **argv) {
  unw_addr_space_t as;
  unw_get_accessors(as);
  return 0;
}

It was in particular testing for unw_get_accessors's existence. Because C is a weird language, if unw_get_accessors doesn't exist then this still actually compiles (with a warning) and fails while linking or potentially at runtime.

They relied on -Werror=implicit-function-declaration to instead make the warning an error and fail compile.

I could just do implicit-function-declaration and add to it as I find more. It's a little tricky to spot when it happens but I know now to look out for false feature detection.

@MikeMcQuaid
Copy link
Member

I could just do implicit-function-declaration and add to it as I find more. It's a little tricky to spot when it happens but I know now to look out for false feature detection.

Yeh, this seems like a good call 👍

@Bo98 Bo98 changed the title shims/super/cc: allow -Werror=* shims/super/cc: allow -Werror=implicit-function-declaration Apr 15, 2020
@MikeMcQuaid MikeMcQuaid merged commit 863f38e into Homebrew:master Apr 15, 2020
@MikeMcQuaid
Copy link
Member

Thanks again @Bo98!

@Bo98 Bo98 deleted the werror branch April 15, 2020 15:19
@lock lock bot added the outdated PR was locked due to age label May 20, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants